const mongoose = require('mongoose');
//声明schema
const BlogSchema = mongoose.Schema({
	username: String,
	title: String,
	content: String,
	hrefid: Number,
	pic: String,
	datetime: String,
	fmpath: String,
	stars:Number,
	comment: [{
		usercomment: String,
		commented: String,
		avatar: String,
		time: String
	}]

});
//根据schema生成model
const model = {
	Blog: mongoose.model('Blog', BlogSchema)
};

module.exports = model;